interface TyphoonInfo {
  selectedYear: string
  partialWindLayerShow: boolean
  globalWindLayerShow: boolean
}

export const useTyphoonStore = defineStore('typhoon-store', {
  state: (): TyphoonInfo => {
    return {
      selectedYear: '2024',
      partialWindLayerShow: true,
      globalWindLayerShow: true
    }
  },
  getters: {
    year(state) {
      return state.selectedYear
    }
  },
  actions: {
    setSelectedYear(newData: string) {
      this.selectedYear = newData
    }
  },
  persist: {
    storage: localStorage
  }
})
